import {
  mapGetters
} from 'vuex'
export default {
  computed: {
    ...mapGetters('car', ['totalCount']),
  },
  watch: {
    totalCount: {
      handler() {
        this.setBadge()
      },
      immediate: true
    }
  },
  methods: {
    setBadge() {
      uni.setTabBarBadge({
        index: 2,
        text: this.totalCount.toString()
      })
    }
  }
}
